<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html" ; charset="utf-8" />
    <title>宏宇教育信息采集</title>
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />
    <link
      href="../../../bstable/css/bootstrap.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../../../bstable/css/bootstrap-table.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../../../layer_v2.1/layer/skin/layer.css"
      rel="stylesheet"
      type="text/css"
    />
    <link href="../../../css/new.css" rel="stylesheet" type="text/css" />
  </head>

  <body>
    <!-- <div class="lx-top">
        宏宇教育信息采集
    </div> -->

    <div class="lx-section">
      <div class="title">基本信息</div>
      <div class="lx-form">
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-50">
            <a class="find_a"><span style="color: red">*</span> 姓名：</a>
            <input
              id="name"
              type="text"
              maxlength="10"
              class="form_input text_ient"
            />
          </p>
          <p class="col lx-col-50">
            <a class="find_a"><span style="color: red">*</span>身份证号：</a>
            <input
              id="idno"
              type="text"
              maxlength="18"
              class="form_input text_ient"
            />
          </p>
        </div>
        <div class="p_line text_ient lx-row ptb10">
          <div class="col lx-col-50">
            <a class="find_a">身份证正面：</a>
            <p class="img-con front-con">
              <img src="" />
              <b class="del-img">❌</b>
            </p>
            <input
              id="id-front"
              type="file"
              class="input-file"
              accept="image/*"
            />
          </div>
          <div class="col lx-col-50">
            <a class="find_a">身份证反面：</a>
            <p class="img-con">
              <img src="" />
              <b class="del-img">❌</b>
            </p>
            <input
              id="id-back"
              type="file"
              class="input-file"
              accept="image/*"
            />
          </div>
        </div>
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-25">
            <a class="find_a"><span style="color: red">*</span>电话：</a>
            <input
              id="phone"
              type="text"
              maxlength="11"
              class="form_input text_ient"
            />
          </p>
          <p class="col lx-col-25">
            <a class="find_a">民族：</a>
            <input id="nation" type="text" class="form_input text_ient" />
          </p>
          <p class="col lx-col-25">
            <a class="find_a">性别：</a>
            <input id="sex" type="text" class="form_input text_ient" />
          </p>
          <p class="col lx-col-25">
            <a class="find_a">生日：</a>
            <input type="date" id="birth" class="form_input text_ient" />
          </p>
        </div>
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-100">
            <a class="find_a">住址：</a>
            <input type="text" id="address" class="form_input text_ient" />
          </p>
        </div>
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-33">
            <a class="find_a">邮箱：</a>
            <input
              id="email"
              type="text"
              maxlength="20"
              class="form_input text_ient"
            />
          </p>
          <p class="col lx-col-33">
            <a class="find_a">QQ：</a>
            <input
              id="qq"
              type="text"
              maxlength="13"
              class="form_input text_ient"
            />
          </p>
          <p class="col lx-col-33">
            <a class="find_a">工作单位：</a>
            <input
              id="company"
              type="text"
              maxlength="13"
              style="width: 70%"
              class="form_input text_ient"
            />
          </p>
        </div>

        <div class="p_line text_ient lx-row ptb10">
          <div class="col lx-col-50">
            <a class="find_a">1寸蓝/白底照片：</a>
            <p class="img-con front-con">
              <img src="" />
              <b class="del-img">❌</b>
            </p>
            <input id="1cun" type="file" class="input-file" accept="image/*" />
          </div>
          <div class="col lx-col-50">
            <a class="find_a">2寸蓝/白底照片：</a>
            <p class="img-con">
              <img src="" />
              <b class="del-img">❌</b>
            </p>
            <input id="2cun" type="file" class="input-file" accept="image/*" />
          </div>
        </div>
      </div>
    </div>

    <div class="lx-section">
      <div class="title">第一学历</div>
      <div class="p_line text_ient lx-row">
        <p class="col lx-col-33">
          <a class="find_a">学历层次：</a>

          <input id="educationName" type="text" class="form_input text_ient" />
          <!-- <input id="major1" type="text" class="form_input text_ient" placeholder="请输入专业名称" /> -->
        </p>
        <p class="col lx-col-33">
          <a class="find_a">专业：</a>
          <input id="zhuanye" type="text" class="form_input text_ient" />
        </p>
        <p class="col lx-col-33">
          <a class="find_a">毕业院校：</a>
          <input
            id="school"
            type="text"
            style="width: 75%"
            class="form_input text_ient"
          />
        </p>
      </div>
      <div class="p_line text_ient lx-row">
        <p class="col lx-col-33">
          <a class="find_a">学习形式：</a>
          <input
            id="studyMode"
            type="text"
            style="width: 75%"
            class="form_input text_ient"
          />
        </p>
        <p class="col lx-col-33">
          <a class="find_a">证书编号：</a>
          <input
            id="certificateNumber"
            type="text"
            style="width: 75%"
            class="form_input text_ient"
          />
        </p>
        <p class="col lx-col-33">
          <a class="find_a">毕业时间：</a>
          <input
            id="time"
            type="date"
            style="width: 75%"
            class="form_input text_ient"
          />
        </p>
      </div>
      <div class="p_line text_ient lx-row ptb10">
        <div class="col lx-col-33">
          <a class="find_a">毕业证：</a>
          <p class="img-con front-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input
            id="biyezheng1"
            type="file"
            class="input-file"
            accept="image/*"
          />
        </div>
        <div class="col lx-col-33">
          <a class="find_a">学位证：</a>
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input
            id="xueweizheng1"
            type="file"
            class="input-file"
            accept="image/*"
          />
        </div>
        <div class="col lx-col-33">
          <a class="find_a">电子注册表：</a>
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input
            id="zhucebiao1"
            type="file"
            style="width: 65%"
            class="input-file"
            accept="image/*"
          />
        </div>
      </div>
    </div>

    <div class="lx-section">
      <div class="title">第二学历</div>
      <div class="p_line text_ient lx-row">
        <p class="col lx-col-33">
          <a class="find_a">学历层次：</a>

          <input
            id="educationName2"
            type="text"
            class="form_input text_ient"
            placeholder=""
          />
          <!-- <input id="major1" type="text" class="form_input text_ient" placeholder="请输入专业名称" /> -->
        </p>
        <p class="col lx-col-33">
          <a class="find_a">专业：</a>
          <input
            id="zhuanye2"
            type="text"
            class="form_input text_ient"
            placeholder=""
          />
        </p>
        <p class="col lx-col-33">
          <a class="find_a">毕业院校：</a>
          <input
            id="school2"
            type="text"
            style="width: 75%"
            class="form_input text_ient"
            placeholder=""
          />
        </p>
      </div>
      <div class="p_line text_ient lx-row">
        <p class="col lx-col-33">
          <a class="find_a">学习形式：</a>
          <input
            id="studyMode2"
            type="text"
            style="width: 75%"
            class="form_input text_ient"
            placeholder=""
          />
        </p>
        <p class="col lx-col-33">
          <a class="find_a">证书编号：</a>
          <input
            id="certificateNumber2"
            type="text"
            style="width: 75%"
            class="form_input text_ient"
            placeholder=""
          />
        </p>
        <p class="col lx-col-33">
          <a class="find_a">毕业时间：</a>
          <input
            id="time2"
            type="date"
            style="width: 75%"
            class="form_input text_ient"
            placeholder=""
          />
        </p>
      </div>
      <div class="p_line text_ient lx-row ptb10">
        <div class="col lx-col-33">
          <a class="find_a">毕业证：</a>
          <p class="img-con front-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input
            id="biyezheng2"
            type="file"
            class="input-file"
            accept="image/*"
          />
        </div>
        <div class="col lx-col-33">
          <a class="find_a">学位证：</a>
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input
            id="xueweizheng2"
            type="file"
            class="input-file"
            accept="image/*"
          />
        </div>
        <div class="col lx-col-33">
          <a class="find_a">电子注册表：</a>
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input
            id="zhucebiao2"
            type="file"
            style="width: 65%"
            class="input-file"
            accept="image/*"
          />
        </div>
      </div>
    </div>

    <div class="lx-section" id="zsInfo">
      <div class="title">证书信息</div>
      <div class="p_line text_ient lx-row">
        <div class="col lx-col-50 lx-zheng">
          <a class="find_a">证书：</a>
          <input type="text" class="form_input text_ient" placeholder="" />
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input id="zh1" type="file" class="input-file" accept="image/*" />
        </div>
        <div class="col lx-col-50 lx-zheng">
          <a class="find_a">证书：</a>
          <input type="text" class="form_input text_ient" placeholder="" />
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input id="zh2" type="file" class="input-file" accept="image/*" />
        </div>
      </div>
      <div class="p_line text_ient lx-row ptb10">
        <div class="col lx-col-50 lx-zheng">
          <a class="find_a">证书：</a>
          <input type="text" class="form_input text_ient" placeholder="" />
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input id="zh3" type="file" class="input-file" accept="image/*" />
        </div>
        <div class="col lx-col-50 lx-zheng">
          <a class="find_a">证书：</a>
          <input type="text" class="form_input text_ient" placeholder="" />
          <p class="img-con">
            <img src="" />
            <b class="del-img">❌</b>
          </p>
          <input id="zh4" type="file" class="input-file" accept="image/*" />
        </div>
      </div>
    </div>

    <div class="lx-section" style="display: none" id="xueli_div">
      <div class="title">学历报考信息</div>
      <div class="lx-row"></div>
    </div>

    <div class="lx-section" style="display: none" id="zhiye_div">
      <div class="title">职业报考信息</div>
      <div class="lx-row"></div>
    </div>

    <div class="lx-section" style="display: none" id="zhicheng_div">
      <div class="title">职称报考信息</div>
      <div class="lx-row"></div>
    </div>

    <div class="lx-section" style="display: none" id="peixun_div">
      <div class="title">培训报考信息</div>
      <div class="lx-row"></div>
    </div>

    <div id="xueli" style="display: none"></div>

    <div id="zhiye" style="display: none"></div>
    <div id="zhicheng" style="display: none"></div>
    <div id="peixun" style="display: none"></div>

    <div class="xueReport lx-section" id="reason-info" style="display: none">
      <div class="title">退款信息</div>
      <div class="lx-row">
        <div class="p_line text_ient lx-row ptb10">
          <a class="find_a">应退费用：</a>
          <input type="text" class="form_input text_ient" />
          <a class="find_a">扣除费用：</a>
          <input type="text" class="form_input text_ient" />
          <a class="find_a">实退费用：</a>
          <input type="text" class="form_input text_ient" />
        </div>
      </div>
    </div>

    <div class="lx-section" id="reason-con" style="display: none">
      <div class="title">退款原因</div>
      <div class="lx-form">
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-100">
            <textarea
              cols="3"
              type="textarea"
              maxlength="200"
              class="form_input text_ient reason"
              placeholder="请输入原因"
            ></textarea>
          </p>
        </div>
      </div>
    </div>

    <div class="lx-section" id="pay-info" style="display: none">
      <div class="title">收款人信息</div>
      <div class="lx-form">
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-100">
            <textarea
              cols="3"
              type="textarea"
              maxlength="200"
              class="form_input text_ient reason"
              placeholder="请输入原因"
            ></textarea>
          </p>
        </div>
      </div>
    </div>

    <div class="lx-section" id="pingzheng" style="display: none">
      <div class="title">财务凭证信息</div>
      <div class="lx-form">
        <div class="p_line text_ient lx-row ptb10">
          <div class="col lx-col-33 pz1">
            <a class="find_a">缴费凭证：</a>
            <p class="img-con" style="display: inline-block">
              <img src="" id="jiaofei" />
            </p>
          </div>
          <div class="col lx-col-33 pz1">
            <a class="find_a">优惠凭证：</a>
            <p class="img-con" style="display: inline-block">
              <img src="" id="youhui" />
            </p>
          </div>
          <div class="col lx-col-33 pz1">
            <a class="find_a">其他凭证：</a>
            <p class="img-con" style="display: inline-block">
              <img src="" id="qita" />
            </p>
          </div>
        </div>
      </div>
    </div>

    <div class="lx-section" id="bohui-info" style="display: none">
      <div class="title">驳回原因</div>
      <div class="lx-form">
        <div class="p_line text_ient lx-row">
          <p class="col lx-col-100">
            <textarea
              id="reason"
              cols="3"
              type="textarea"
              maxlength="200"
              class="form_input text_ient reason"
              placeholder="请输入原因"
            ></textarea>
          </p>
        </div>
      </div>
    </div>

    <div
      id="check-buttons"
      style="text-align: center; margin-bottom: 30px; display: none"
    >
      <button class="a_add" id="resolve">审核通过</button>
      <button class="a_add" id="reject">驳回</button>
    </div>

    <div class="big-img" style="display: none">
      <img src="" alt="" />
    </div>

    <script src="../../../js/jquery.js"></script>
    <script src="../../../js/common.js"></script>
    <script src="../../../layer_v2.1/layer/layer.js"></script>
    <script src="../../../bstable/js/bootstrap-table.js"></script>
    <script src="../../../bstable/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="../../../js/laydate-master/laydate.js"></script>
    <script src="./register-info.js"></script>

    <script>
      function postFees(data, commitFlag) {
        // fee.refundableFee(应退费用)
        // fee.deductFee(扣除费用)
        // fee.realRefundFee(实退费用)
        // fee.refundInfo(退款原因)
        // fee.payee(收款人信息)
        // fee.businessProgress(业务进度)

        data.map((item, index) => {
          console.log("item=>>>>>>>>>>>>>>>>>>>>>>>", item);

          item.commitFlag = commitFlag;
          if (commitFlag == 4) {
            // item.flag = $('.fee').find('.fee-flag').eq(index).val()
            item.flag = $(".update-flag").eq(index).val();
          }

          // if (!item.commitBoolean) {
          //     item.commitBoolean = 0
          // }

          delete item.createDate;
        });

        $.ajax({
          url: baseUrl + "studentInfo/updateFee",
          method: "post",
          headers: {
            Authorization: JSON.parse(localStorage.getItem("userInfo")).token,
          },
          contentType: "application/json",
          data: JSON.stringify(data),
          success: function (data) {
            alert("审核通过");
            window.location.href =
              pageFrom === "jiaofei"
                ? "../store/moneySearch.html"
                : "../trade/tradeSearch.html";
          },
        });
      }

      function getQuery(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
          var pair = vars[i].split("=");
          if (pair[0] == variable) {
            return pair[1];
          }
        }
        return false;
      }

      var flag = getQuery("flag");
      var feeId = "";

      if (getQuery("from") === "student") {
        localStorage.setItem("name", "学生管理/学生信息查询/审核");
      } else if (getQuery("from") === "jiaowu") {
        localStorage.setItem("name", "教务管理/教务信息管理/审核");
      } else if (getQuery("from") === "jiaofei") {
        localStorage.setItem("name", "财务管理/缴费信息管理/审核");
      } else if (getQuery("from") === "fenqi") {
        localStorage.setItem("name", "学生管理/分期缴费信息查询/审核");
      }

      var info = {
        fileInput: $(".input-file"),
        delBtn: $(".del-img"),
        isEdit: false,
        init: function () {
          this.fileChange();
          this.initDisableInput();
          $("#pingzheng").show();
        },
        initEvent() {
          $(".fee-flag").change(() => {
            console.log("change===========");
            this.isEdit = true;
          });
        },
        fileChange: function () {
          var self = this;
          this.fileInput.on("change", function () {
            var files = this.files;
            var id = $(this).attr("id");
            if (files.length) {
              id === "id-front" && self.uploadFrontImg(files[0]);
              $(this).hide();
              $(this).siblings(".img-con").css("display", "inline-block");
              self.drawImg($(this).siblings(".img-con").find("img"), files[0]);
            }
          });
        },
        showRefundInfo() {
          $("#reason-info").show();
          $("#reason-con").show();
          $("#pay-info").show();
          $("#pingzheng").show();
          $("#bohui-info").show();
          if (getQuery("from") === "student") {
            $("#reason-info").find("input").prop("disabled", false);
            $("textarea").prop("disabled", false);
          }
        },
        showButtons() {
          $("#reason").attr("disabled", false);
          $("#check-buttons").show();
        },
        drawImg: function ($el, file) {
          var URL = window.URL || window.webkitURL;
          file.fname = "123123.jpg";
          console.log(file);

          var imgUrl = URL.createObjectURL(file);
          $el.attr("src", imgUrl);
        },
        initDisableInput() {
          $("input").prop("disabled", true);
          $("select").prop("disabled", true);
          $("textarea").prop("disabled", true);
          $(".del-img").hide();
          $(".fee-flag").prop(
            "disabled",
            getQuery("from") === "jiaofei" ? false : true
          );
        },
      };

      info.init();

      function getUserInfo(idNo, type, studyId) {
        $.ajax({
          url: baseUrl + "studentInfo/getStudentInfo",
          method: "get",
          headers: {
            Authorization: JSON.parse(localStorage.getItem("userInfo")).token,
          },
          data: {
            idNo: idNo,
            trainType: type,
            studyId: studyId,
          },
          success: function (data) {
            if (!data.student) {
              return alert("未找到对应的数据");
            }

            var fees = data.fees;
            window.fees = fees;
            fees.map((item, index) => {
              $("#reason-info input").eq(0).val(item.refundableFee);
              $("#reason-info input").eq(1).val(item.deductFee);
              $("#reason-info input").eq(2).val(item.realRefundFee);
              $("#reason-con textarea").eq(0).val(item.refundInfo);
              $("#pay-info textarea").eq(0).val(item.payee);
            });

            var student = data.student;

            var education = data.studentEducation;

            var train = data.studentTrain;

            var title = data.studentTitle;

            var occu = data.studentOccupation;

            window.uploadId = student.id;

            showImg(data.studentCards);

            if (fees[0].denyReason) {
              $("#bohui-info").show();
              $("#reason").show();
              $("#reason").val(fees[0].denyReason);
            }

            // 根据报考类型来查看对应的内容
            if (type == "education" && education.length !== 0) {
              var registerInfo = new RegisterInfo(type);
              var { infoDom, feeDom } = registerInfo.initLookEducations(
                education,
                fees
              );
              // 根据trainType进行对应的报考信息渲染
              $("#xueli_div").show();
              $("#xueli_div .lx-row").html(infoDom);
              $("#xueli").show();
              $("#xueli").html(feeDom);
              $("#xueli .fee").show();
            }
            // 职业
            if (type == "occupation") {
              let registerInfo = new RegisterInfo(type);
              let { infoDom, feeDom } = registerInfo.initLookOccupations(
                occu,
                fees
              );
              $("#zhiye_div").show();
              $("#zhiye_div .lx-row").html(infoDom);
              $("#zhiye").show();
              $("#zhiye").html(feeDom);
              $("#zhiye .fee").show();
            }

            if (type == "title") {
              let registerInfo = new RegisterInfo(type);
              let { infoDom, feeDom } = registerInfo.initLookTitles(
                title,
                fees
              );
              $("#zhicheng_div").show();
              $("#zhicheng_div .lx-row").html(infoDom);
              $("#zhicheng").show();
              $("#zhicheng").html(feeDom);
              $("#zhicheng .fee").show();
            }

            if (type == "train") {
              let registerInfo = new RegisterInfo(type);
              let { infoDom, feeDom } = registerInfo.initLookTrains(
                train,
                fees
              );
              $("#peixun_div").show();
              $("#peixun_div .lx-row").html(infoDom);
              $("#peixun").show();
              $("#peixun").html(feeDom);
              $("#peixun .fee").show();
            }

            info.initDisableInput();

            if (getQuery("from") == "jiaofei") {
              info.initEvent();
              window.fees.map((item, index) => {
                if (item.flag) {
                  $(".fee-flag").eq(index).prop("disabled", true);
                  info.isEdit = true;
                } else {
                  $(".fee-flag").eq(index).addClass("update-flag");
                  info.isEdit = false;
                }
              });
            }

            info.showButtons();

            $("#bohui-info").show();

            $("#name").val(student.name);
            $("#phone").val(student.phoneNum);
            $("#idno").val(student.idNo);
            $("#nation").val(student.nation);
            $("#sex").val(student.sex);
            $("#birth").val(student.birthday);
            $("#address").val(student.address);
            $("#email").val(student.email);
            $("#qq").val(student.qqNumber);
            $("#company").val(student.workAdress);

            // 第一学历
            $("#zhuanye").val(student.major);
            $("#educationName").val(student.educationName);
            $("#school").val(student.graduateSchool);
            $("#studyMode").val(student.studyMode);
            $("#certificateNumber").val(student.certificateNumber);
            $("#time").val(student.graduateTime);

            if (
              !(
                student.major ||
                student.educationName ||
                student.graduateSchool ||
                student.studyMode ||
                student.certificateNumber ||
                student.graduateTime
              )
            ) {
              $("#educationName").parent().parent().parent().hide();
            }
            // 第二学历
            $("#zhuanye2").val(student.major2);
            $("#educationName2").val(student.educationName2);
            $("#school2").val(student.educationName2);
            $("#studyMode2").val(student.studyMode2);
            $("#time2").val(student.graduateTime2);
            $("#certificateNumber2").val(student.certificateNumber2);

            if (
              !(
                student.major2 ||
                student.educationName2 ||
                student.graduateSchool2 ||
                student.studyMode2 ||
                student.certificateNumber2 ||
                student.graduateTime2
              )
            ) {
              $("#educationName2").parent().parent().parent().hide();
            }

            // if (!($('#zh1').val() || $('#zh2').val() || $('#zh3').val() || $('#zh4').val())) {
            //     $('#zh1').parent().parent().parent().hide();
            // }
          },
        });
      }

      function showImg(list) {
        $("#zsInfo").hide();
        if (!list.length) return;
        var maps = ["id-front", "id-back", "byz", "xwz"],
          maps1 = [
            "1cun",
            "2cun",
            "biyezheng1",
            "xueweizheng1",
            "zhucebiao1",
            "biyezheng2",
            "xueweizheng2",
            "zhucebiao2",
          ],
          maps2 = ["jiaofei", "youhui", "qita"],
          zh1,
          zh2,
          zh3,
          zh4,
          id;
        list.forEach(function (item, index) {
          if (maps.includes(item.property)) {
            $("#" + item.property).hide();
            $("#" + item.property)
              .siblings("p")
              .css("display", "inline-block")
              .find("img")
              .attr(
                "src",
                baseUrl +
                  "studentInfo/picDownload?url=" +
                  encodeURIComponent(item.fileResource)
              );
          } else if (maps1.includes(item.property)) {
            console.log(item);
            $("#" + item.property)
              .siblings("p")
              .css("display", "inline-block")
              .find("img")
              .attr(
                "src",
                baseUrl +
                  "studentInfo/picDownload?url=" +
                  encodeURIComponent(item.fileResource)
              );
          } else if (maps2.includes(item.property)) {
            $("#" + item.property)
              .attr(
                "src",
                baseUrl +
                  "studentInfo/picDownload?url=" +
                  encodeURIComponent(item.fileResource)
              )
              .parents(".pz1")
              .css({ display: "inline-block" });
          } else {
            console.log(zh1, 11, item);
            if (!zh1) {
              id = "zh1";
              zh1 = 1;
            } else if (!zh2) {
              id = "zh2";
              zh2 = 1;
            } else if (!zh3) {
              zh3 = 1;
              id = "zh3";
            } else {
              zh4 = 1;
              id = "zh4";
            }
            $("#zsInfo").show();
            $("#" + id).hide();
            console.log(id);
            if (item.property || item.fileResource) {
              $("#" + id)
                .siblings("p")
                .css("display", "inline-block")
                .find("img")
                .attr(
                  "src",
                  baseUrl +
                    "studentInfo/picDownload?url=" +
                    encodeURIComponent(item.fileResource)
                );
              $("#" + id)
                .siblings("input")
                .val(item.property);
            }
          }
        });
      }

      var pageFrom = "";
      if (getQuery("from")) {
        var from = getQuery("from");
        var id = getQuery("id");
        var type = getQuery("type");
        var trainType = getQuery("trainType");
        var idNo = getQuery("idNo");
        var studyId = getQuery("studyId");
        pageFrom = from;
        setTimeout(() => {
          getUserInfo(idNo, trainType, studyId);
        }, 500);
      }

      var reasonUrl =
        pageFrom === "jiaofei"
          ? baseUrl + "studentInfo/caiwuCheck"
          : baseUrl + "studentInfo/jiaowuCheck";

      $("#resolve").on("click", function () {
        if (getQuery("from") === "jiaowu") {
          info.isEdit = true;
        }
        console.log("实缴费用： ", $(".shijiao").val());
        console.log("每期费用： ", $(".fee-money").val());
        let feeCount = 0;
        let realPayFee;
        window.fees.map((item) => {
          realPayFee = +item.realPayFee;
          if (item.flag) {
            feeCount += +item.amount;
          }
        });
        if (realPayFee === feeCount) {
          window.fees = window.fees.filter((item) => item.flag);
          info.isEdit = true;
        } else {
          window.fees = window.fees.filter((item) => !item.flag);
        }
        console.log("feeCount", feeCount);
        console.log("this.isEdit", info.isEdit);
        console.log("所有期数： ", window.fees);
        if (!info.isEdit) {
          layer.open({
            type: 0,
            offset: "t",
            title: "审核温馨提示",
            content: "请确认是否已缴费？",
            // btn: ['是', '否'],
            // yes: function (index) {
            //     var comFlag = pageFrom === 'jiaofei' ? 4 : 6
            //     var data = {
            //         // studentId: getQuery('id'),
            //         studyId: getQuery('studyId'),
            //         userId: JSON.parse(localStorage.getItem('userInfo')).userId,
            //         checkType: 1,
            //         denyReason: '',
            //         commitFlag: comFlag,
            //     }
            // },
          });
        } else {
          layer.open({
            type: 0,
            offset: "t",
            title: "审核温馨提示",
            content: "该信息是否已符合审核标准,确认审核通过?",
            btn: ["是", "否"],
            yes: function (index) {
              var comFlag = pageFrom === "jiaofei" ? 4 : 6;
              var data = {
                // studentId: getQuery('id'),
                studyId: getQuery("studyId"),
                userId: JSON.parse(localStorage.getItem("userInfo")).userId,
                checkType: 1,
                denyReason: "",
                commitFlag: comFlag,
              };
              $.ajax({
                url: reasonUrl,
                method: "post",
                headers: {
                  Authorization: JSON.parse(localStorage.getItem("userInfo"))
                    .token,
                },
                data: data,
                success: function (res) {
                  if (res.code === 200) {
                    postFees(window.fees, comFlag);
                    layer.close(index);
                    // if (comFlag === 4) {
                    //     postFees(window.fees, comFlag)
                    // } else {
                    //    alert('审核通过')
                    // }
                  } else {
                    alert(res.message);
                    return;
                  }
                },
              });
            },
          });
        }
      });

      $("#reject").on("click", function () {
        layer.open({
          type: 0,
          offset: "t",
          title: "提示",
          content: "是否要驳回？",
          btn: ["是", "否"],
          yes: function (index) {
            var comFlag = pageFrom === "jiaofei" ? 3 : 5;
            var reason = $("#reason").val();
            if (!reason) {
              return alert("请输入驳回原因");
            }
            var data = {
              // studentId: getQuery('id'),
              studyId: getQuery("studyId"),
              userId: JSON.parse(localStorage.getItem("userInfo")).userId,
              checkType: 2,
              denyReason: reason,
              commitFlag: comFlag,
            };
            $.ajax({
              url: reasonUrl,
              method: "post",
              headers: {
                Authorization: JSON.parse(localStorage.getItem("userInfo"))
                  .token,
              },
              data: data,
              success: function (res) {
                if (res.code === 200) {
                  alert("已驳回");
                } else {
                  alert(res.message);
                  return;
                }
                layer.close(index);
                window.location.href =
                  pageFrom === "jiaofei"
                    ? "../store/moneySearch.html"
                    : "../trade/tradeSearch.html";
              },
            });
          },
        });
      });

      function bigShow(src) {
        $(".big-img img").attr("src", src);
        $(".big-img").show();
      }
      $(".big-img").on("click", function () {
        $(".big-img").hide();
      });

      $(".img-con img").on("click", function () {
        var src = $(this).attr("src");
        if (src.endsWith("pdf")) {
          src = encodeURIComponent(location.origin + src);
          window.open("../../pdf/web/viewer.html?file=" + src);
        } else {
          bigShow(src);
        }
      });
    </script>
  </body>
</html>
